<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<html>
  <head>
    <base href="<%=basePath%>"/>
    
    <title>部门列表</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" href="style/default.css" type="text/css" />
	<script src="js/common.js"></script>

  </head>
  
  <body onload="tipMsg('${tip}');setPage(<s:property value='#request.page.pageNum'/>,<s:property value='#request.page.totalPage'/>)">
  <form action="organization/org_listOrg.action" method="post" name="f1" >
    <table align="center" class="condition">
       <tr>
          <td width="125">部门编号：</td><td width="300"><input type="text" name="orgNo"></td>
          <td width="125">部门名称：</td><td width="300"><input type="text" name="orgName"></td>
          <td width="125"><input type="submit" value="查询" class="btn"></td>
       </tr>
    </table>
  </form>
    <br/><br/><br/>

   <table class="title" align="center">
      <tr>
		        <td align="left">部门信息列表</td>
			    <td align="right"><input type="button" value="添加" class="btn" onclick="location.href='<%=request.getContextPath() %>/jsp/org/addOrg.jsp'"/></td>
	  </tr>
   </table>
   
   <table class="result" align="center">
	         <tr align="center">
		        <th width="200">部门编号</th>
			    <th width="200">部门名称</th>
		        <th width="300">操作</th>
		     </tr>
		     <s:if test="#request.page.list.isEmpty">
		        <tr align="center">
		          <td colspan="3">没有符合条件的数据</td>
		        </tr>
		     </s:if>
		     <s:else>
		     <s:iterator value="#request.page.list" var="org">
		     <tr>
		        <td><s:property value="#org.orgNo"/></td>
				<td><s:property value="#org.orgName"/></td>
				<td>
				    <a href="organization/org_detailOrg.action?orgId=<s:property value='#org.orgId'/>">޸查看详情</a>&nbsp;&nbsp;
				    <a href="organization/org_getOrgInfo.action?orgId=<s:property value='#org.orgId'/>">修改</a>&nbsp;&nbsp;
				    <a href="organization/org_delOrg.action?orgId=<s:property value='#org.orgId'/>" onclick="return confirm('是否确认删除？')">删除</a>
				</td>
				</tr>
				</s:iterator>
		     </s:else>
    </table>
    <table align="center" class="title">
    <tr  align="right">
	<td> 
	<form action="organization/org_listOrg.action" method="post" name="f2">
	<input type="hidden" name="orgNo" value="<s:property value='#request.condition[0]'/>"/>
	<input type="hidden" name="orgName" value="<s:property value='#request.condition[1]'/>"/>
	<input type="hidden" name="pageNum" value="<s:property value='#request.page.pageNum'/>" id="pageNum"/>
	</form>
	&lt;&lt;
	<input type="button" class="btn" value="首页" onclick="getList(1)"/> &lt;
    <input type="button" class="btn" value="上一页" id="pre" onclick="getList(<s:property value='#request.page.pageNum-1'/>)"> | 
    <input type="button" class="btn" value="下一页" id="next" onclick="getList(<s:property value='#request.page.pageNum+1'/>)"> &gt; 
    <input type="button" class="btn" value="尾页" onclick="getList(<s:property value='#request.page.totalPage'/>)"> &gt;&gt;&nbsp;
           共<s:property value='#request.page.totalNum'/>条记录&nbsp;&nbsp;当前<s:property value='#request.page.pageNum'/>/<s:property value='#request.page.totalPage'/>页
	 </td>
	</tr>
	</table>
  </body>
</html>
